package com.ruoyi.fina.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.fina.mapper.FinSummaryMapper;
import com.ruoyi.fina.domain.FinSummary;
import com.ruoyi.fina.service.IFinSummaryService;
import com.ruoyi.common.core.text.Convert;

/**
 * 财务汇总Service业务层处理
 * 
 * @author useragent-1
 * @date 2025-05-26
 */
@Service
public class FinSummaryServiceImpl implements IFinSummaryService 
{
    @Autowired
    private FinSummaryMapper finSummaryMapper;

    /**
     * 查询财务汇总
     * 
     * @param summaryId 财务汇总主键
     * @return 财务汇总
     */
    @Override
    public FinSummary selectFinSummaryBySummaryId(Long summaryId)
    {
        return finSummaryMapper.selectFinSummaryBySummaryId(summaryId);
    }

    /**
     * 查询财务汇总列表
     * 
     * @param finSummary 财务汇总
     * @return 财务汇总
     */
    @Override
    public List<FinSummary> selectFinSummaryList(FinSummary finSummary)
    {
        return finSummaryMapper.selectFinSummaryList(finSummary);
    }

    /**
     * 新增财务汇总
     * 
     * @param finSummary 财务汇总
     * @return 结果
     */
    @Override
    public int insertFinSummary(FinSummary finSummary)
    {
        finSummary.setCreateTime(DateUtils.getNowDate());
        return finSummaryMapper.insertFinSummary(finSummary);
    }

    /**
     * 修改财务汇总
     * 
     * @param finSummary 财务汇总
     * @return 结果
     */
    @Override
    public int updateFinSummary(FinSummary finSummary)
    {
        finSummary.setUpdateTime(DateUtils.getNowDate());
        return finSummaryMapper.updateFinSummary(finSummary);
    }

    /**
     * 批量删除财务汇总
     * 
     * @param summaryIds 需要删除的财务汇总主键
     * @return 结果
     */
    @Override
    public int deleteFinSummaryBySummaryIds(String summaryIds)
    {
        return finSummaryMapper.deleteFinSummaryBySummaryIds(Convert.toStrArray(summaryIds));
    }

    /**
     * 删除财务汇总信息
     * 
     * @param summaryId 财务汇总主键
     * @return 结果
     */
    @Override
    public int deleteFinSummaryBySummaryId(Long summaryId)
    {
        return finSummaryMapper.deleteFinSummaryBySummaryId(summaryId);
    }
}
